The invention relates generally to a method for adaptively enhancing a digital image based on image content. In particular, the invention relates to a method of improving the image quality of a digital image received via the world wide web (i.e., the Internet) by determining its image type and applying an appropriate enhancement technique.
Images printed from the Internet often appear coarse due to the resolution of the digital image data. For example, jagged structure is often observable along lines and edge features in the image. Commercially available printers generally have output resolutions which exceed the resolution of Internet images. Unfortunately, the higher printer resolution typically is not useful for improving the quality in the printed image.
Digital images can generally be characterized as either line art images or continuous tone images. Line art images typically include backgrounds and/or objects having spatially invariant color and intensity. Examples of line art images include block diagrams, road maps, computer generated images (e.g., weather maps, computer game images) and standard text. Continuous tone images are characterized by a greater number of colors and intensities. Examples of continuous tone images include photographic images, anti-aliased text and graphics.
Line art images and continuous tone images can be processed so that the printed image has a higher quality than an unprocessed printed image. Due to the difference in image content, however, the methods used to enhance these images are different. Because a web page can contain both types of images, implementation of only one enhancement method results in some images not being optimally enhanced. Moreover, even if line art enhancement and continuous tone enhancement methods are available, application of the appropriate method cannot be determined in advance due to the absence of any identifier of image type transmitted with the image data.
The present invention relates to a method of enhancing a digital image. The invention applies a preferred one of a plurality of enhancement techniques to be automatically applied to a received digital image based upon its image type. The method includes the steps of receiving a source array of RGB image pixels. Based on the values of the RGB image pixels, a determination is made as to whether the image corresponds to one of a first and a second image type. The source array is processed with a first enhancement technique if the source array is determined to be of the first image type or processed with a second enhancement technique if the source array is determined to be of the second image type. In one embodiment, the source array is received from a web page. In another embodiment, the first image type is a line art image. In another embodiment, the second image type is a continuous tone image.
In another aspect, a method of determining the image type of a digital image includes receiving a source array of RGB pixels and applying an M by N window to each of a plurality of pixels in the source array to generate a plurality of windowed arrays. The color number (i.e., the number of different colors) for each of the windowed arrays is determined. For each of a plurality of color numbers, the number of windowed arrays having the respective color number is determined. An image type is determined in response to the determinations of the number of windowed arrays having the respective color number. In one embodiment, each of the colors corresponds to a respective predetermined range of RGB values.
In one embodiment, the image type is determined by calculating, for a subset of the plurality of color numbers, a color range total and determining the image type in response to the color range total. In another embodiment, the method includes the additional step of calculating, for a complementary subset of the plurality of color numbers, a complementary color range total. In one embodiment, the image type is determined by calculating a ratio of the color range total and the complementary color range total, and determining the image type in response to the ratio.
In another aspect, the invention features a system for enhancing a digital image. The system includes an image switch having a switch input, a first switch output and a second switch output. The system also includes a first processing module having an input in communication with the first switch output and a second processing module having an input in communication with the second switch output. The image switch provides digital image data received at the switch input to the input of the first processing module if the image type is a first image type. The image switch provides the digital image data to the input of the second processing module if the image type is a second image type. The first processing module and the second processing module provide enhanced digital image data at their respective outputs in response to digital image data received at their respective inputs.